import pymysql

if __name__ == '__main__':
    # connc = pymysql.Connect(
    #     host="localhost",
    #     user="root",
    #     password="123456",
    #     database="text_dba",
    #     port=3306,
    #     charset="utf8",
    # )
    # cur = connc.cursor()
    # sql = "insert into info values(%s,%s,%s,%s)"
    # add_data = [7, "zhangsan", 22, "n"]
    # cur.execute(sql, add_data)
    # connc.commit()
    # sql = "select * from info"
    # cur.execute(sql)
    # result = cur.fetchall()
    # print(result)
    # cur.close()
    # connc.close()
    connc = pymysql.Connect(
        host="localhost",
        user="root",
        password="123456",
        database="text_dba",
        port=3306,
        charset="utf8"
    )
    cur = connc.cursor()
    sql = "update info set name=%s where name='fff'"
    update_date=["aaaaaaaa"]
    cur.execute(sql,update_date)
    connc.commit()
    cur.close()
    connc.close()


